<html>
<head>
</head>
<body>

<script type="text/javascript">
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","http://api-pub.dictionary.com/v001?vid=gi6mmn5fmidijlc9thyhokl8z0fdtby9t4wgs2wek9&q=esoteric&type=synonyms",true);                                       
xmlhttp.onreadystatechange = function(){
	if(xmlhttp.readyState == 4) {
	document.write("haha");
	xmlDoc=xmlhttp.responseXML; 
	document.write("haha2");
	 alert(xmlDoc) 



	//var x=xmlDoc.getElementsByTagName("headword");
	//document.write("haha3");
	//var content = x[0].firstChild;
	//document.write("haha4");
    //while(content != null && content.nodeType != 4) content = content.nextSibling;
    //document.write("haha5");
	//document.write(content);
	
	}
}

xmlhttp.send();



//document.write("<table border='1'>");
//var x=xmlDoc.getElementsByTagName("headword");
//for (i=0;i<x.length;i++)
 // { 
  //document.write("<tr><td>");
  //var content = x[i].firstChild;
  //while(content != null && content.nodeType != 4) content = content.nextSibling;
  
 // var content = x[0].firstChild;
 // while(content != null && content.nodeType != 4) content = content.nextSibling;
  //document.write("content");
  
  //document.write("</td><td>");
  //document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
  //document.write("</td></tr>");
 // }
<!-- document.write("dididi"); //-->

</script>
  
</body>
</html>